Skip to content

Fix react native 0.85 absolutefillobject#4906

Merged
satya164 merged 5 commits intocallstack:mainfrom
fracico-tech:fix-react-native-0.85-absolutefillobject
May 7, 2026
Merged

Fix react native 0.85 absolutefillobject#4906
satya164 merged 5 commits intocallstack:mainfrom
fracico-tech:fix-react-native-0.85-absolutefillobject

Conversation

@fracico-tech
Copy link
Copy Markdown
Contributor

Motivation

This PR fixes a layout regression where Dialogs, Modals, and Portals appear at the bottom of the screen instead of being centered or properly positioned.

The issue was introduced with React Native 0.85, which removed StyleSheet.absoluteFillObject. Since React Native Paper uses the spread operator (...StyleSheet.absoluteFillObject) in several components, these styles were returning undefined, causing absolute positioning to fail.

This change introduces a robust fallback to ensure the library remains compatible with both React Native 0.85+ and older versions.

Related issue

Fixes an issue where UI components using Portal or Modal lose their fullscreen overlay and centering on RN 0.85.

Test plan

Environment: React Native 0.85.0, Android/iOS.

Steps:

Open a Dialog or Modal component.

Verify the component is centered on the screen and the underlay covers the entire background.

Backward Compatibility:

Verified that the manual object fallback { position: 'absolute', ... } behaves identically to the previous absoluteFillObject on older versions of React Native.

Before:

Dialogs stuck at the bottom of the screen.

Underlay/Overlay has 0 height/width.

After:

Dialogs correctly centered.

Underlay correctly covers the full screen.

@callstack-bot
Copy link
Copy Markdown

callstack-bot commented Apr 28, 2026

Hey @fracico-tech, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@OkancanCosar
Copy link
Copy Markdown

hey, this pr need to merge for rn 0.85.x please consider to merge urgently

Copy link
Copy Markdown
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. However it doesn't need condition like this. Replacing StyleSheet.absoluteFillObject with StyleSheet.absoluteFill is safe and enough.

@fracico-tech
Copy link
Copy Markdown
Contributor Author

I can't simply swap it for ...StyleSheet.absoluteFill here. Since absoluteFill can return a style ID (number) rather than an object, spreading it (...) would result in an empty object and break the positioning.
I think mine is the safer approach

@satya164
Copy link
Copy Markdown
Member

satya164 commented May 7, 2026

I can't simply swap it for ...StyleSheet.absoluteFill here. Since absoluteFill can return a style ID

It hasn't returned a number since React Native 0.60. It's essentially the same as absoluteFillObject facebook/react-native@a8e3c7f

@satya164 satya164 merged commit 2fea2cd into callstack:main May 7, 2026
2 of 3 checks passed
@satya164
Copy link
Copy Markdown
Member

satya164 commented May 7, 2026

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants